package cn.isjinhao.se.sql.evaluation;

import cn.isjinhao.se.sql.evaluation.visitor.EvaluationRunTimeContext;
import cn.isjinhao.se.sql.evaluation.visitor.SingleSelectPostProcessVisitor;
import cn.isjinhao.se.sql.evaluation.visitor.SingleSelectResultVisitor;
import cn.isjinhao.se.sql.evaluation.visitor.SingleSelectTableSegVisitor;
import cn.isjinhao.se.sql.evaluation.visitor.SingleSelectWhereSegVisitor;
import cn.isjinhao.se.sql.grammar.CurdStatement;
import cn.isjinhao.se.sql.grammar.statement.retrieve.represention.*;
import cn.isjinhao.se.sql.grammar.statement.retrieve.visitor.SelectVisitorWithDelegate;

/**
 * @Author ISJINHAO
 * @Date 2021/4/11 19:59
 */
public class SqlEvaluator extends SelectVisitorWithDelegate<Object> implements Evaluator<Object> {

    private EvaluationRunTimeContext evaluationRunTimeContext;

    private SingleSelectTableSegVisitor tableSegVisitor;

    private SingleSelectWhereSegVisitor whereSegVisitor;

    private SingleSelectPostProcessVisitor postProcessVisitor;

    private SingleSelectResultVisitor resultVisitor;

    public SqlEvaluator(EvaluationRunTimeContext evaluationRunTimeContext) {
        this.evaluationRunTimeContext = evaluationRunTimeContext;
        whereSegVisitor = new SingleSelectWhereSegVisitor(evaluationRunTimeContext, this);
        tableSegVisitor = new SingleSelectTableSegVisitor();
        postProcessVisitor = new SingleSelectPostProcessVisitor();
        resultVisitor = new SingleSelectResultVisitor();
    }

    /**
     * SqlEvaluator 本身的作用是将传入的集合
     *
     *
     * @param curdStatement
     * @return
     */
    @Override
    public Object evaluate(CurdStatement curdStatement) {
        return null;
    }

    @Override
    public Object visitSelect(Select select) {
        return null;
    }

    @Override
    public Object visitSingleSelect(SingleSelect singleSelect) {
        return null;
    }

    @Override
    public Object visitColumnSeg(ColumnSeg columnSeg) {
        return null;
    }

    @Override
    public Object visitColumnRep(ColumnRep columnRep) {
        return null;
    }

    @Override
    public Object visitTableSeg(TableSeg tableSeg) {
        return null;
    }

    @Override
    public Object visitTableRep(TableRep tableRep) {
        return null;
    }

    @Override
    public Object visitInCondition(InCondition inCondition) {
        return null;
    }

    @Override
    public Object visitExistsCondition(ExistsCondition existsCondition) {
        return null;
    }

    @Override
    public Object visitGroupBySeg(GroupBySeg groupBySeg) {
        return null;
    }

    @Override
    public Object visitOrderBySeg(OrderBySeg orderBySeg) {
        return null;
    }

    @Override
    public Object visitLimitSeg(LimitSeg limitSeg) {
        return null;
    }

    @Override
    public Object visitGroupFunction(GroupFunction groupFunction) {
        return null;
    }

    @Override
    public Object visitCaseWhen(CaseWhen caseWhen) {
        return null;
    }

}
